//表格数据
import {reactive} from "vue";
import router from "@/router.js";
import { message, Modal } from 'ant-design-vue';
import {Table} from "@/class/table";


interface Dog<T>{
    value:T
}

//用户信息
class User extends Table {
   // constructor(data:{}) {super(data);} //调用同名的属性和方法
   
    protected columns=[{ //修表头
        title: '姓名',
        dataIndex: 'nickname',
        key: 'nickname'
    },
    {
        title: '手机号',
        dataIndex: 'phone',
        key: 'phone',
    },
    {
        title: '邮箱',
        dataIndex: 'email',
        key: 'email',
    },{
        title: '操作',
        key: 'operation',
        fixed: 'right',
        width:200,
        slots:{ customRender: 'action' },
    }]

    constructor(parameters) {//构造函数定义初始化的状态
        super();
        this.getList()
    }


    public getList(){ //获取用户信息
        console.log("获取用户信息===>")
        this.data.columns=this.columns;
        let res={"code":200,"data":{"endRow":2,"hasNextPage":false,"hasPreviousPage":false,"isFirstPage":true,"isLastPage":true,"list":[{"email":"877137356@qq.com","id":"1","nickname":"管理员","phone":"18785112455","state":1,"username":"admin"},{"email":"lisi@ebuy.com","id":"1382767636533870592","nickname":"李四","phone":"18900000000","state":1,"username":"zhangsan"}],"navigateFirstPage":1,"navigateLastPage":1,"navigatePages":8,"navigatepageNums":[1],"nextPage":0,"pageNum":1,"pageSize":10,"pages":1,"prePage":0,"size":2,"startRow":1,"total":2},"message":"请求成功"}
        this.data.loading=false;
        this.data.list=res.data.list;
        this.data.total=res.data.total;
    }

   public del(){//删除表格
      console.log("删除表格数据~~~~~~~~~")
   } 
}

export const userClass= new User();